package com.demo.service.system;

import java.util.List;

import com.demo.dto.Pager;
import com.demo.exception.ServiceLayerException;
import com.demo.model.system.Permission;
import com.demo.model.system.PermissionExample;

public interface PermissionService {
	/**
	 * 添加一个权限
	 * @param record
	 * @return
	 * @throws ServiceLayerException 
	 */
	int add(Permission record) throws ServiceLayerException;
	
	/**
	 * 批量添加权限
	 * @param record
	 * @return
	 * @throws ServiceLayerException 
	 */
	int addBatch(List<Permission> records) throws ServiceLayerException;

	/**
	 * 修改单个权限信息
	 * @param record
	 * @return
	 * @throws ServiceLayerException 
	 */
	int update(Permission record) throws ServiceLayerException;

	/**
	 * 批量启用权限
	 * @param ids
	 * @return
	 * @throws ServiceLayerException 
	 */
	int enable(List<Integer> ids) throws ServiceLayerException;

	/**
	 * 批量停用权限
	 * @param ids
	 * @return
	 * @throws ServiceLayerException 
	 */
	int disable(List<Integer> ids) throws ServiceLayerException;
	
	/**
	 * 根据主键查询单条权限记录
	 * @param id
	 * @return
	 * @throws ServiceLayerException 
	 */
	Permission getById(Integer id) throws ServiceLayerException;
	
	/**
	 * 查询符合条件的权限记录列表
	 * @param example
	 * @return
	 */
	List<Permission> findByCondition(PermissionExample example);
	
	/**
	 * 分页查询符合条件的权限记录列表
	 * @param example
	 * @param pager
	 * @return
	 * @throws ServiceLayerException 
	 */
	Pager<Permission> findByPage(PermissionExample example, Pager<Permission> pager) throws ServiceLayerException;

	/**
	 * 查询符合条件的权限记录的数量
	 * @param example
	 * @return
	 */
	int getCount(PermissionExample example);
	
	/**
	 * 批量删除权限
	 * @param example
	 * @return
	 */
	int deleteByCondition(PermissionExample example);	
}
